package com.cardgame.model.level;

import com.cardgame.model.buff.Buff;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

// Buff/deBuff实例，包含id、持续时间、类型
@Setter
@Getter
public class LevelBuff {
    private final Buff buff;
    private int duration; // 剩余回合数

    public LevelBuff(Buff buff) {
        this.buff = buff;
        this.duration = buff.getBuffDuration();
    }

    @Override
    public String toString() {
        return "BuffInstance{" +
                "buff=" + buff +
                ", duration=" + duration +
                '}';
    }

    public Map<String, Object> toMap() {
        Map<String, Object> map = new HashMap<>(buff.toMap());
        map.put("duration", duration);
        return map;
    }
}
